/*
 * (c) 2016
 * <tanghaifeng-gz@loongson.cn> <pengren.mcu@qq.com>
 *
 * SPDX-License-Identifier:	GPL-2.0+
 *
 */

#include <common.h>
#include <asm/io.h>

#include <mach/ls1x.h>

void _machine_restart(void)
{
	void __iomem *wdt_base = ioremap_nocache(LS1X_WDT_BASE, 0x0f);

	__raw_writel(0x1, wdt_base + WDT_EN);
	__raw_writel(0x1, wdt_base + WDT_TIMER);
	__raw_writel(0x1, wdt_base + WDT_SET);

	while (1)
		;
}
